#pragma once

#include "SocketStream.h"
#include <windows.h>

class Win32PipeStream : public SocketStream {
public:
    explicit Win32PipeStream(size_t bufsize = 10000);
    virtual ~Win32PipeStream();
    virtual SocketStream *accept();
    virtual int connect();

    virtual int commitBuffer(size_t size);
    virtual const unsigned char *readFully(void *buf, size_t len);
    virtual const unsigned char *read(void *buf, size_t *inout_len);
    virtual void forceStop();

private:
    Win32PipeStream(HANDLE pipe, size_t bufSize);
    HANDLE  m_pipe;
};
